package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.proxy.RpcClientProxy;
import com.lagou.rpc.consumer.zookeeper.ZkHelper;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author boting.guo
 * @date 2021/11/6 23:32
 */

@RestController
@RequestMapping("user")
public class UserController {

//    @Autowired
//    private ZkHelper zkHelper;
//
//   private IUserService userService = (IUserService) RpcClientProxy.createProxy(IUserService.class, zkHelper);
//
//   @GetMapping("{id}")
//   public User getById(@PathVariable("id") int id) {
//      User user = userService.getById(id);
//      System.out.println(user);
//      return user;
//   }
}
